package com.z.controller;


import com.z.pojo.Goods;
import com.z.service.GoodsService;
import com.z.service.impl.GoodsServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/admin/manage/adminfindbygid.do")
public class AdminFindByGidServlet extends HttpServlet {
    
    private GoodsService goodsService =  new GoodsServiceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String gid = req.getParameter("gid");
        Goods goods =null;
        goods = goodsService.goodsInfo(Integer.valueOf(gid));
        req.setAttribute("goods",goods);
        req.getRequestDispatcher("/admin/manage/product-moddify.jsp").forward(req,resp);
    }
}
